import News from '@/models/news';
import { HttpRequest } from 'xo-web-base';

/**
 * 新闻接口
 */
export default class NewsService {
  /**
   * 新闻列表
   * @param pageNumber
   * @param pageSize
   * @returns
   */
  static list(pageNumber: number = 1, pageSize: number = 10) {
    return HttpRequest.post<News>('/information/web/v1/news/list', {
      pageNumber: pageNumber,
      pageSize: pageSize,
    });
  }

  /**
   * 新闻详情
   * @param id
   * @returns
   */
  static info(id: any) {
    return HttpRequest.post<News>('/information/web/v1/news/info', {
      id: id,
    });
  }
}
